/*
 * Diego Zamboni Latance 			344990
 * Fellipe Augusto Ruiz de Souza 	344796
 * 
 */
package ast;

public class VariableExpr extends Expr {

	public VariableExpr(Variable variable) {
		this.variable = variable;
	}

	public void genC(PW pw, boolean putParenthesis) {
		pw.print(variable.getName());
	}

	public Type getType() {
		return variable.getType();
	}

	public void genKrakatoa(PW pw, boolean putParenthesis) {
		if (variable.getThiss())
			pw.print("this.");
		variable.genKrakatoa(pw);
	}

	private Variable variable;
}